package com.xstudio.controllers;

import com.xstudio.dao.SysMenuMapper;
import com.xstudio.models.SysMenu;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * Created by kira on 16/2/28.
 */
@Controller
@RequestMapping(value = "/admin")
public class MainformController {

    @RequestMapping(value = "/index")
    public String index(HttpServletRequest request, Model model) {
        return "admin/index";
    }

    @RequestMapping(value = "/setMenuSession")
    @ResponseBody
    public String setMenuSession(HttpServletRequest request, Model model,
                                 String id, String subid) {
        request.getSession().setAttribute("_sid", id);
        request.getSession().setAttribute("_subid", subid);
        return "";
    }
}
